#pragma once

#include "../cmn/cmn.h"

typedef struct MSPIX_API
{
	unsigned char* p_src_img;
	unsigned char* p_af_map;
	int img_width;
	int img_height;
	int layer_id;

	int valid_s_pix_num;
	int max_s_pix_num;
	int split_th;

	int min_spix_size;
	int max_spix_size;

	short*  p_s_pix_map;
	unsigned char* p_edge_map;
	unsigned char* p_seg_map;
	unsigned char* p_debug_img;
	S_Pix* p_spix;

}MSPIX_API;

extern void init_mspix(unsigned char* p_src_img, unsigned char* p_af_map, int width, int height, MSPIX_API* p_spix_api, int layer_id);
extern void run_mspix(MSPIX_API* p_spix_api, sp_output* p_sp_out);

extern int g_neighbor_matrix[][S_PIX_NUM];
extern unsigned char g_spix_debug_map[];
